/**
 * System:      oshys
 * Model:     	log
 * Licence:     GNU General Public License v3
 * Author:      sunwl
 * Date:		2010/02/19
 */
package org.oshys.util.logging;

/**
 * Log消息实体类。<br>
 * 
 * @author sunwl
 */
public class LogMessage {

	private Level level = null;

	private String message = null;

	private Throwable thrown = null;
	
	protected LogMessage(Level level, String message, Throwable thrown) {
		this.level = level;
		this.message = message;
		this.thrown = thrown;
	}

	protected LogMessage(String levelName, String message, Throwable thrown) {
		this.level = Level.getLevel(levelName);
		this.message = message;
		this.thrown = thrown;
	}

	protected String getMessage() {
		return this.message;
	}

	protected Level getLevel(){
		return this.level;
	}
	
    public Throwable getThrown() {
		return thrown;
	}

	public void setThrown(Throwable thrown) {
		this.thrown = thrown;
	}
	
	public String toString(){
		return this.level.getName() + "," + this.getMessage();
	}
	
}
